﻿using System;
using System.IO;

namespace SharpTrainer
{
    public class TimeFileLog : ITimeDevice
    {
        public void Print(string moduleName, string time)
        {
            FileStream fs = new FileStream("C:\\PerformanceLog_" + DateTime.Now.ToString("yyyyMMdd") + ".log", FileMode.Create);
            StreamWriter streamWriter = new StreamWriter(fs);
            streamWriter.BaseStream.Seek(0, SeekOrigin.End);
            streamWriter.WriteLine("******************************* Performance Log *******************************");
            streamWriter.WriteLine("Module: " + moduleName + ", Time Consumed: " + time);
            streamWriter.WriteLine("*******************************************************************************");
            streamWriter.Flush();

        }
    }
}
